﻿using ConfExpert.Datasets;
using DevExpress.XtraReports.UI;
using DevTeam;
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Drawing.Printing;

public class xrTopluBedenDagilimi : DevExpress.XtraReports.UI.XtraReport
{
    #region Designer generated code

    #region Members
    private DevExpress.XtraReports.UI.DetailBand Detail;
    private DevExpress.XtraReports.UI.TopMarginBand TopMargin;
    private DevExpress.XtraReports.UI.BottomMarginBand BottomMargin;
    private MyData oMyData;
    private ReportFooterBand ReportFooter;
    private ReportHeaderBand ReportHeader;
    private XRPictureBox xrPictureBox1;
    private XRLabel x1;
    private DetailBand HeaderBand;
    private DetailReportBand Header;
    private DetailReportBand DetailReport;
    private DetailBand DetailBand;
    private XRTable xtM;
    private XRTableRow xrTableRow1;
    private XRTableCell x4;
    private XRTableCell xrTableCell2;
    private XRTableRow xrTableRow8;
    private XRTableCell x5;
    private XRTableCell xrTableCell11;
    private XRTableRow xrTableRow7;
    private XRTableCell x35;
    private XRTableCell xModelNo;
    private XRTableRow xrTableRow6;
    private XRTableCell x6;
    private XRTableCell xrTableCell5;
    private XRTable xrTable3;
    private XRTableRow xrTableRow3;
    private XRTableCell x2;
    private XRTableCell x2a;
    private XRTableRow xrTableRow5;
    private XRTableCell x3;
    private XRTableCell x3a;
    private XRControlStyle xrControlStyle1;
    private XRTable xtGarni;
    private XRTableRow xrTableRow33;
    private XRTableCell tcKumas;
    private PageFooterBand PageFooter;
    private GroupFooterBand GroupFooter1;
    private XRPageBreak xrPageBreak2;
    private XRLabel xrLabel4;
    private XRLabel x33;
    private XRTable xrTable2;
    private XRTableRow xrTableRow23;
    private XRTableCell xrTableCell40;
    private XRTable xrTable4;
    private XRTableRow xrTableRow15;
    private XRTableCell xrTableCell27; 
    #endregion

    private XRLine xrLine1;
    private XRTableRow xrTableRow20;
    private XRTableCell x36;
    private XRTableCell x4a;
    private ConfExpert.Datasets.MyDataTableAdapters.xKF_DetailTableAdapter xKF_DetailTableAdapter;
    private ConfExpert.Datasets.MyDataTableAdapters.xKF_HeaderTableAdapter xKF_HeaderTableAdapter;
    private GroupHeaderBand GroupHeader1;
    private XRTable tbGarniHeader;
    private XRTableRow xrTableRow4;
    private XRTableCell xrTableCell3;
    private XRTable xrTable1;
    private XRTableRow xrTableRow21;
    private XRTableCell tcDosyaNo;
    private XRPageInfo xrPageInfo1;
    private GroupFooterBand GroupFooter2;

    private System.ComponentModel.IContainer components = null;

    private void InitializeComponent()
    {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(xrTopluBedenDagilimi));
            this.Detail = new DevExpress.XtraReports.UI.DetailBand();
            this.TopMargin = new DevExpress.XtraReports.UI.TopMarginBand();
            this.BottomMargin = new DevExpress.XtraReports.UI.BottomMarginBand();
            this.ReportFooter = new DevExpress.XtraReports.UI.ReportFooterBand();
            this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand();
            this.xrControlStyle1 = new DevExpress.XtraReports.UI.XRControlStyle();
            this.PageFooter = new DevExpress.XtraReports.UI.PageFooterBand();
            this.oMyData = new ConfExpert.Datasets.MyData();
            this.DetailReport = new DevExpress.XtraReports.UI.DetailReportBand();
            this.DetailBand = new DevExpress.XtraReports.UI.DetailBand();
            this.xtGarni = new DevExpress.XtraReports.UI.XRTable();
            this.xrTableRow33 = new DevExpress.XtraReports.UI.XRTableRow();
            this.tcKumas = new DevExpress.XtraReports.UI.XRTableCell();
            this.GroupFooter1 = new DevExpress.XtraReports.UI.GroupFooterBand();
            this.xrPageBreak2 = new DevExpress.XtraReports.UI.XRPageBreak();
            this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand();
            this.tbGarniHeader = new DevExpress.XtraReports.UI.XRTable();
            this.xrTableRow4 = new DevExpress.XtraReports.UI.XRTableRow();
            this.xrTableCell3 = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrLine1 = new DevExpress.XtraReports.UI.XRLine();
            this.xKF_DetailTableAdapter = new ConfExpert.Datasets.MyDataTableAdapters.xKF_DetailTableAdapter();
            this.Header = new DevExpress.XtraReports.UI.DetailReportBand();
            this.HeaderBand = new DevExpress.XtraReports.UI.DetailBand();
            this.xrTable4 = new DevExpress.XtraReports.UI.XRTable();
            this.xrTableRow15 = new DevExpress.XtraReports.UI.XRTableRow();
            this.xrTableCell27 = new DevExpress.XtraReports.UI.XRTableCell();
            this.xtM = new DevExpress.XtraReports.UI.XRTable();
            this.xrTableRow1 = new DevExpress.XtraReports.UI.XRTableRow();
            this.x4 = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableRow8 = new DevExpress.XtraReports.UI.XRTableRow();
            this.x5 = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableCell11 = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableRow7 = new DevExpress.XtraReports.UI.XRTableRow();
            this.x35 = new DevExpress.XtraReports.UI.XRTableCell();
            this.xModelNo = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableRow6 = new DevExpress.XtraReports.UI.XRTableRow();
            this.x6 = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableCell5 = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTable2 = new DevExpress.XtraReports.UI.XRTable();
            this.xrTableRow23 = new DevExpress.XtraReports.UI.XRTableRow();
            this.xrTableCell40 = new DevExpress.XtraReports.UI.XRTableCell();
            this.x33 = new DevExpress.XtraReports.UI.XRLabel();
            this.xrLabel4 = new DevExpress.XtraReports.UI.XRLabel();
            this.xrTable3 = new DevExpress.XtraReports.UI.XRTable();
            this.xrTableRow3 = new DevExpress.XtraReports.UI.XRTableRow();
            this.x2 = new DevExpress.XtraReports.UI.XRTableCell();
            this.x2a = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableRow5 = new DevExpress.XtraReports.UI.XRTableRow();
            this.x3 = new DevExpress.XtraReports.UI.XRTableCell();
            this.x3a = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrTableRow20 = new DevExpress.XtraReports.UI.XRTableRow();
            this.x36 = new DevExpress.XtraReports.UI.XRTableCell();
            this.x4a = new DevExpress.XtraReports.UI.XRTableCell();
            this.x1 = new DevExpress.XtraReports.UI.XRLabel();
            this.xrPictureBox1 = new DevExpress.XtraReports.UI.XRPictureBox();
            this.xKF_HeaderTableAdapter = new ConfExpert.Datasets.MyDataTableAdapters.xKF_HeaderTableAdapter();
            this.GroupFooter2 = new DevExpress.XtraReports.UI.GroupFooterBand();
            this.xrTable1 = new DevExpress.XtraReports.UI.XRTable();
            this.xrTableRow21 = new DevExpress.XtraReports.UI.XRTableRow();
            this.tcDosyaNo = new DevExpress.XtraReports.UI.XRTableCell();
            this.xrPageInfo1 = new DevExpress.XtraReports.UI.XRPageInfo();
            ((System.ComponentModel.ISupportInitialize)(this.oMyData)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.xtGarni)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.tbGarniHeader)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.xrTable4)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.xtM)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
            // 
            // Detail
            // 
            this.Detail.Dpi = 254F;
            this.Detail.HeightF = 0F;
            this.Detail.Name = "Detail";
            this.Detail.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 254F);
            this.Detail.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
            // 
            // TopMargin
            // 
            this.TopMargin.Dpi = 254F;
            this.TopMargin.HeightF = 84F;
            this.TopMargin.Name = "TopMargin";
            this.TopMargin.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 254F);
            this.TopMargin.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
            // 
            // BottomMargin
            // 
            this.BottomMargin.Dpi = 254F;
            this.BottomMargin.HeightF = 30F;
            this.BottomMargin.Name = "BottomMargin";
            this.BottomMargin.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 254F);
            this.BottomMargin.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
            // 
            // ReportFooter
            // 
            this.ReportFooter.Dpi = 254F;
            this.ReportFooter.Expanded = false;
            this.ReportFooter.HeightF = 0F;
            this.ReportFooter.Name = "ReportFooter";
            // 
            // ReportHeader
            // 
            this.ReportHeader.Dpi = 254F;
            this.ReportHeader.HeightF = 0F;
            this.ReportHeader.Name = "ReportHeader";
            // 
            // xrControlStyle1
            // 
            this.xrControlStyle1.BackColor = System.Drawing.Color.WhiteSmoke;
            this.xrControlStyle1.Name = "xrControlStyle1";
            this.xrControlStyle1.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 254F);
            // 
            // PageFooter
            // 
            this.PageFooter.Dpi = 254F;
            this.PageFooter.HeightF = 0F;
            this.PageFooter.Name = "PageFooter";
            // 
            // oMyData
            // 
            this.oMyData.DataSetName = "MyData";
            this.oMyData.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
            // 
            // DetailReport
            // 
            this.DetailReport.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
            this.DetailBand,
            this.GroupFooter1,
            this.GroupHeader1,
            this.GroupFooter2});
            this.DetailReport.DataAdapter = this.xKF_DetailTableAdapter;
            this.DetailReport.DataMember = "xKF_Header.FK_xKF_Detail_xKF_Header";
            this.DetailReport.DataSource = this.oMyData;
            this.DetailReport.Dpi = 254F;
            this.DetailReport.Level = 0;
            this.DetailReport.Name = "DetailReport";
            // 
            // DetailBand
            // 
            this.DetailBand.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
            this.xtGarni});
            this.DetailBand.Dpi = 254F;
            this.DetailBand.HeightF = 63.5F;
            this.DetailBand.MultiColumn.ColumnCount = 2;
            this.DetailBand.Name = "DetailBand";
            // 
            // xtGarni
            // 
            this.xtGarni.Dpi = 254F;
            this.xtGarni.LocationFloat = new DevExpress.Utils.PointFloat(31.75F, 0F);
            this.xtGarni.Name = "xtGarni";
            this.xtGarni.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
            this.xrTableRow33});
            this.xtGarni.SizeF = new System.Drawing.SizeF(500F, 63.5F);
            // 
            // xrTableRow33
            // 
            this.xrTableRow33.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.tcKumas});
            this.xrTableRow33.Dpi = 254F;
            this.xrTableRow33.Name = "xrTableRow33";
            this.xrTableRow33.Weight = 1D;
            // 
            // tcKumas
            // 
            this.tcKumas.Dpi = 254F;
            this.tcKumas.Name = "tcKumas";
            this.tcKumas.Text = "xrTableCell206";
            this.tcKumas.Weight = 3D;
            // 
            // GroupFooter1
            // 
            this.GroupFooter1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
            this.xrTable1,
            this.xrPageInfo1});
            this.GroupFooter1.Dpi = 254F;
            this.GroupFooter1.HeightF = 58.42F;
            this.GroupFooter1.Name = "GroupFooter1";
            this.GroupFooter1.PrintAtBottom = true;
            this.GroupFooter1.RepeatEveryPage = true;
            // 
            // xrPageBreak2
            // 
            this.xrPageBreak2.Dpi = 254F;
            this.xrPageBreak2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
            this.xrPageBreak2.Name = "xrPageBreak2";
            // 
            // GroupHeader1
            // 
            this.GroupHeader1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
            this.tbGarniHeader,
            this.xrLine1});
            this.GroupHeader1.Dpi = 254F;
            this.GroupHeader1.HeightF = 77.77795F;
            this.GroupHeader1.Name = "GroupHeader1";
            this.GroupHeader1.RepeatEveryPage = true;
            // 
            // tbGarniHeader
            // 
            this.tbGarniHeader.Dpi = 254F;
            this.tbGarniHeader.LocationFloat = new DevExpress.Utils.PointFloat(31.75F, 14.27796F);
            this.tbGarniHeader.Name = "tbGarniHeader";
            this.tbGarniHeader.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
            this.xrTableRow4});
            this.tbGarniHeader.SizeF = new System.Drawing.SizeF(500F, 63.5F);
            // 
            // xrTableRow4
            // 
            this.xrTableRow4.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.xrTableCell3});
            this.xrTableRow4.Dpi = 254F;
            this.xrTableRow4.Name = "xrTableRow4";
            this.xrTableRow4.Weight = 1D;
            // 
            // xrTableCell3
            // 
            this.xrTableCell3.Dpi = 254F;
            this.xrTableCell3.Name = "xrTableCell3";
            this.xrTableCell3.Text = "xrTableCell206";
            this.xrTableCell3.Weight = 3D;
            // 
            // xrLine1
            // 
            this.xrLine1.BackColor = System.Drawing.Color.Transparent;
            this.xrLine1.BorderColor = System.Drawing.Color.DarkGray;
            this.xrLine1.BorderDashStyle = DevExpress.XtraPrinting.BorderDashStyle.Solid;
            this.xrLine1.Borders = DevExpress.XtraPrinting.BorderSide.Top;
            this.xrLine1.BorderWidth = 2F;
            this.xrLine1.Dpi = 254F;
            this.xrLine1.ForeColor = System.Drawing.Color.Transparent;
            this.xrLine1.LineWidth = 0;
            this.xrLine1.LocationFloat = new DevExpress.Utils.PointFloat(31.75F, 0F);
            this.xrLine1.Name = "xrLine1";
            this.xrLine1.Padding = new DevExpress.XtraPrinting.PaddingInfo(1, 1, 1, 1, 254F);
            this.xrLine1.SizeF = new System.Drawing.SizeF(2823.848F, 14.27795F);
            this.xrLine1.StylePriority.UseBackColor = false;
            this.xrLine1.StylePriority.UseBorderColor = false;
            this.xrLine1.StylePriority.UseBorderDashStyle = false;
            this.xrLine1.StylePriority.UseBorders = false;
            this.xrLine1.StylePriority.UseBorderWidth = false;
            this.xrLine1.StylePriority.UseForeColor = false;
            this.xrLine1.StylePriority.UsePadding = false;
            // 
            // xKF_DetailTableAdapter
            // 
            this.xKF_DetailTableAdapter.ClearBeforeFill = true;
            // 
            // Header
            // 
            this.Header.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
            this.HeaderBand,
            this.DetailReport});
            this.Header.DataAdapter = this.xKF_HeaderTableAdapter;
            this.Header.DataMember = "xKF_Header";
            this.Header.DataSource = this.oMyData;
            this.Header.Dpi = 254F;
            this.Header.Level = 0;
            this.Header.Name = "Header";
            // 
            // HeaderBand
            // 
            this.HeaderBand.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
            this.xrTable4,
            this.xrTable2,
            this.xrTable3,
            this.x1,
            this.xrPictureBox1});
            this.HeaderBand.Dpi = 254F;
            this.HeaderBand.HeightF = 435.1868F;
            this.HeaderBand.MultiColumn.ColumnCount = 2;
            this.HeaderBand.Name = "HeaderBand";
            this.HeaderBand.BeforePrint += new System.Drawing.Printing.PrintEventHandler(this.HeaderBand_BeforePrint);
            // 
            // xrTable4
            // 
            this.xrTable4.Dpi = 254F;
            this.xrTable4.LocationFloat = new DevExpress.Utils.PointFloat(31.75F, 157.5625F);
            this.xrTable4.Name = "xrTable4";
            this.xrTable4.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
            this.xrTableRow15});
            this.xrTable4.SizeF = new System.Drawing.SizeF(863.7444F, 270.8444F);
            // 
            // xrTableRow15
            // 
            this.xrTableRow15.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.xrTableCell27});
            this.xrTableRow15.Dpi = 254F;
            this.xrTableRow15.Name = "xrTableRow15";
            this.xrTableRow15.Weight = 1D;
            // 
            // xrTableCell27
            // 
            this.xrTableCell27.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
            this.xtM});
            this.xrTableCell27.Dpi = 254F;
            this.xrTableCell27.Name = "xrTableCell27";
            this.xrTableCell27.Text = "xrTableCell27";
            this.xrTableCell27.Weight = 3D;
            // 
            // xtM
            // 
            this.xtM.BorderColor = System.Drawing.Color.DimGray;
            this.xtM.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top) 
            | DevExpress.XtraPrinting.BorderSide.Right) 
            | DevExpress.XtraPrinting.BorderSide.Bottom)));
            this.xtM.Dpi = 254F;
            this.xtM.Font = new System.Drawing.Font("Calibri", 14F);
            this.xtM.KeepTogether = true;
            this.xtM.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
            this.xtM.Name = "xtM";
            this.xtM.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 3, 3, 3, 254F);
            this.xtM.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
            this.xrTableRow1,
            this.xrTableRow8,
            this.xrTableRow7,
            this.xrTableRow6});
            this.xtM.SizeF = new System.Drawing.SizeF(822.8538F, 254F);
            this.xtM.StylePriority.UseBorderColor = false;
            this.xtM.StylePriority.UseBorders = false;
            this.xtM.StylePriority.UseFont = false;
            this.xtM.StylePriority.UsePadding = false;
            // 
            // xrTableRow1
            // 
            this.xrTableRow1.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.x4,
            this.xrTableCell2});
            this.xrTableRow1.Dpi = 254F;
            this.xrTableRow1.Name = "xrTableRow1";
            this.xrTableRow1.Weight = 1D;
            // 
            // x4
            // 
            this.x4.BackColor = System.Drawing.Color.LightGray;
            this.x4.Dpi = 254F;
            this.x4.Font = new System.Drawing.Font("Calibri", 9.75F, System.Drawing.FontStyle.Bold);
            this.x4.Name = "x4";
            this.x4.StylePriority.UseBackColor = false;
            this.x4.StylePriority.UseFont = false;
            this.x4.StylePriority.UseTextAlignment = false;
            this.x4.Text = "Müşteri";
            this.x4.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
            this.x4.Weight = 0.93470629716554454D;
            // 
            // xrTableCell2
            // 
            this.xrTableCell2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "xKF_Header.Musteri")});
            this.xrTableCell2.Dpi = 254F;
            this.xrTableCell2.Name = "xrTableCell2";
            this.xrTableCell2.Padding = new DevExpress.XtraPrinting.PaddingInfo(6, 3, 3, 3, 254F);
            this.xrTableCell2.StylePriority.UsePadding = false;
            this.xrTableCell2.StylePriority.UseTextAlignment = false;
            this.xrTableCell2.Text = "xrTableCell2";
            this.xrTableCell2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
            this.xrTableCell2.Weight = 2.0652937028344556D;
            // 
            // xrTableRow8
            // 
            this.xrTableRow8.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.x5,
            this.xrTableCell11});
            this.xrTableRow8.Dpi = 254F;
            this.xrTableRow8.Name = "xrTableRow8";
            this.xrTableRow8.Weight = 1D;
            // 
            // x5
            // 
            this.x5.BackColor = System.Drawing.Color.LightGray;
            this.x5.Dpi = 254F;
            this.x5.Font = new System.Drawing.Font("Calibri", 9.75F, System.Drawing.FontStyle.Bold);
            this.x5.Name = "x5";
            this.x5.StylePriority.UseBackColor = false;
            this.x5.StylePriority.UseFont = false;
            this.x5.StylePriority.UseTextAlignment = false;
            this.x5.Text = "Sipariş No.";
            this.x5.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
            this.x5.Weight = 0.93470629716554454D;
            // 
            // xrTableCell11
            // 
            this.xrTableCell11.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "xKF_Header.SipNo")});
            this.xrTableCell11.Dpi = 254F;
            this.xrTableCell11.Name = "xrTableCell11";
            this.xrTableCell11.Padding = new DevExpress.XtraPrinting.PaddingInfo(6, 3, 3, 3, 254F);
            this.xrTableCell11.StylePriority.UsePadding = false;
            this.xrTableCell11.StylePriority.UseTextAlignment = false;
            this.xrTableCell11.Text = "xrTableCell11";
            this.xrTableCell11.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
            this.xrTableCell11.Weight = 2.0652937028344556D;
            // 
            // xrTableRow7
            // 
            this.xrTableRow7.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.x35,
            this.xModelNo});
            this.xrTableRow7.Dpi = 254F;
            this.xrTableRow7.Name = "xrTableRow7";
            this.xrTableRow7.Weight = 1D;
            // 
            // x35
            // 
            this.x35.BackColor = System.Drawing.Color.LightGray;
            this.x35.Dpi = 254F;
            this.x35.Font = new System.Drawing.Font("Calibri", 9.75F, System.Drawing.FontStyle.Bold);
            this.x35.Name = "x35";
            this.x35.StylePriority.UseBackColor = false;
            this.x35.StylePriority.UseFont = false;
            this.x35.StylePriority.UseTextAlignment = false;
            this.x35.Text = "Model No.";
            this.x35.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
            this.x35.Weight = 0.93470629716554454D;
            // 
            // xModelNo
            // 
            this.xModelNo.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "xKF_Header.ModelNo")});
            this.xModelNo.Dpi = 254F;
            this.xModelNo.Font = new System.Drawing.Font("Calibri", 14F, System.Drawing.FontStyle.Bold);
            this.xModelNo.Name = "xModelNo";
            this.xModelNo.Padding = new DevExpress.XtraPrinting.PaddingInfo(6, 3, 3, 3, 254F);
            this.xModelNo.StylePriority.UseFont = false;
            this.xModelNo.StylePriority.UsePadding = false;
            this.xModelNo.StylePriority.UseTextAlignment = false;
            this.xModelNo.Text = "xModelNo";
            this.xModelNo.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
            this.xModelNo.Weight = 2.0652937028344556D;
            // 
            // xrTableRow6
            // 
            this.xrTableRow6.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.x6,
            this.xrTableCell5});
            this.xrTableRow6.Dpi = 254F;
            this.xrTableRow6.Name = "xrTableRow6";
            this.xrTableRow6.Weight = 1D;
            // 
            // x6
            // 
            this.x6.BackColor = System.Drawing.Color.LightGray;
            this.x6.Dpi = 254F;
            this.x6.Font = new System.Drawing.Font("Calibri", 9.75F, System.Drawing.FontStyle.Bold);
            this.x6.Name = "x6";
            this.x6.StylePriority.UseBackColor = false;
            this.x6.StylePriority.UseFont = false;
            this.x6.StylePriority.UseTextAlignment = false;
            this.x6.Text = "Toplam Adet";
            this.x6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
            this.x6.Weight = 0.93470629716554454D;
            // 
            // xrTableCell5
            // 
            this.xrTableCell5.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "xKF_Header.ToplamAdet")});
            this.xrTableCell5.Dpi = 254F;
            this.xrTableCell5.Name = "xrTableCell5";
            this.xrTableCell5.Padding = new DevExpress.XtraPrinting.PaddingInfo(6, 3, 3, 3, 254F);
            this.xrTableCell5.StylePriority.UsePadding = false;
            this.xrTableCell5.StylePriority.UseTextAlignment = false;
            this.xrTableCell5.Text = "xrTableCell5";
            this.xrTableCell5.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
            this.xrTableCell5.Weight = 2.0652937028344556D;
            // 
            // xrTable2
            // 
            this.xrTable2.Dpi = 254F;
            this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(977.7924F, 221.0625F);
            this.xrTable2.Name = "xrTable2";
            this.xrTable2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
            this.xrTableRow23});
            this.xrTable2.SizeF = new System.Drawing.SizeF(1869.125F, 89.95827F);
            // 
            // xrTableRow23
            // 
            this.xrTableRow23.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.xrTableCell40});
            this.xrTableRow23.Dpi = 254F;
            this.xrTableRow23.Name = "xrTableRow23";
            this.xrTableRow23.Weight = 1D;
            // 
            // xrTableCell40
            // 
            this.xrTableCell40.BorderWidth = 0F;
            this.xrTableCell40.CanShrink = true;
            this.xrTableCell40.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
            this.x33,
            this.xrLabel4});
            this.xrTableCell40.Dpi = 254F;
            this.xrTableCell40.Name = "xrTableCell40";
            this.xrTableCell40.StylePriority.UseBorderWidth = false;
            this.xrTableCell40.Weight = 3D;
            // 
            // x33
            // 
            this.x33.Dpi = 254F;
            this.x33.Font = new System.Drawing.Font("Calibri", 9.75F, System.Drawing.FontStyle.Bold);
            this.x33.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
            this.x33.Name = "x33";
            this.x33.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 10, 0, 0, 254F);
            this.x33.SizeF = new System.Drawing.SizeF(312.1665F, 58.41994F);
            this.x33.StylePriority.UseFont = false;
            this.x33.StylePriority.UsePadding = false;
            this.x33.StylePriority.UseTextAlignment = false;
            this.x33.Text = "Garni Pozisyonları";
            this.x33.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
            // 
            // xrLabel4
            // 
            this.xrLabel4.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "xKF_Header.GarniPos")});
            this.xrLabel4.Dpi = 254F;
            this.xrLabel4.Font = new System.Drawing.Font("Calibri", 11F);
            this.xrLabel4.LocationFloat = new DevExpress.Utils.PointFloat(312.1666F, 0F);
            this.xrLabel4.Multiline = true;
            this.xrLabel4.Name = "xrLabel4";
            this.xrLabel4.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 5, 0, 0, 254F);
            this.xrLabel4.SizeF = new System.Drawing.SizeF(1556.958F, 58.41992F);
            this.xrLabel4.StylePriority.UseFont = false;
            this.xrLabel4.StylePriority.UseTextAlignment = false;
            this.xrLabel4.Text = "xrLabel1";
            this.xrLabel4.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
            // 
            // xrTable3
            // 
            this.xrTable3.BorderColor = System.Drawing.Color.DimGray;
            this.xrTable3.Borders = DevExpress.XtraPrinting.BorderSide.None;
            this.xrTable3.Dpi = 254F;
            this.xrTable3.KeepTogether = true;
            this.xrTable3.LocationFloat = new DevExpress.Utils.PointFloat(2286F, 2.645798F);
            this.xrTable3.Name = "xrTable3";
            this.xrTable3.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 3, 3, 10, 254F);
            this.xrTable3.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
            this.xrTableRow3,
            this.xrTableRow5,
            this.xrTableRow20});
            this.xrTable3.SizeF = new System.Drawing.SizeF(560.9165F, 190.5F);
            this.xrTable3.StylePriority.UseBorderColor = false;
            this.xrTable3.StylePriority.UseBorders = false;
            this.xrTable3.StylePriority.UsePadding = false;
            // 
            // xrTableRow3
            // 
            this.xrTableRow3.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.x2,
            this.x2a});
            this.xrTableRow3.Dpi = 254F;
            this.xrTableRow3.Name = "xrTableRow3";
            this.xrTableRow3.Weight = 1D;
            // 
            // x2
            // 
            this.x2.Dpi = 254F;
            this.x2.Font = new System.Drawing.Font("Calibri", 9.75F, System.Drawing.FontStyle.Bold);
            this.x2.Name = "x2";
            this.x2.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 9, 3, 3, 254F);
            this.x2.StylePriority.UseFont = false;
            this.x2.StylePriority.UsePadding = false;
            this.x2.StylePriority.UseTextAlignment = false;
            this.x2.Text = "Tarih";
            this.x2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
            this.x2.Weight = 1.1799995913085277D;
            // 
            // x2a
            // 
            this.x2a.Dpi = 254F;
            this.x2a.Name = "x2a";
            this.x2a.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 3, 3, 3, 254F);
            this.x2a.StylePriority.UsePadding = false;
            this.x2a.StylePriority.UseTextAlignment = false;
            this.x2a.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
            this.x2a.Weight = 2D;
            // 
            // xrTableRow5
            // 
            this.xrTableRow5.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.x3,
            this.x3a});
            this.xrTableRow5.Dpi = 254F;
            this.xrTableRow5.Name = "xrTableRow5";
            this.xrTableRow5.Weight = 1D;
            // 
            // x3
            // 
            this.x3.Dpi = 254F;
            this.x3.Font = new System.Drawing.Font("Calibri", 9.75F, System.Drawing.FontStyle.Bold);
            this.x3.Name = "x3";
            this.x3.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 9, 3, 3, 254F);
            this.x3.StylePriority.UseFont = false;
            this.x3.StylePriority.UsePadding = false;
            this.x3.StylePriority.UseTextAlignment = false;
            this.x3.Text = "DosyaNo";
            this.x3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
            this.x3.Weight = 1.1799995913085277D;
            // 
            // x3a
            // 
            this.x3a.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "xKF_Header.DosyaNo")});
            this.x3a.Dpi = 254F;
            this.x3a.Font = new System.Drawing.Font("Calibri", 16F, System.Drawing.FontStyle.Bold);
            this.x3a.ForeColor = System.Drawing.Color.DarkRed;
            this.x3a.Name = "x3a";
            this.x3a.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 3, 3, 3, 254F);
            this.x3a.StylePriority.UseFont = false;
            this.x3a.StylePriority.UseForeColor = false;
            this.x3a.StylePriority.UsePadding = false;
            this.x3a.StylePriority.UseTextAlignment = false;
            this.x3a.Text = "x3a";
            this.x3a.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
            this.x3a.Weight = 2D;
            // 
            // xrTableRow20
            // 
            this.xrTableRow20.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.x36,
            this.x4a});
            this.xrTableRow20.Dpi = 254F;
            this.xrTableRow20.Name = "xrTableRow20";
            this.xrTableRow20.Weight = 1D;
            // 
            // x36
            // 
            this.x36.Dpi = 254F;
            this.x36.Font = new System.Drawing.Font("Calibri", 9.75F, System.Drawing.FontStyle.Bold);
            this.x36.Name = "x36";
            this.x36.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 8, 3, 3, 254F);
            this.x36.StylePriority.UseFont = false;
            this.x36.StylePriority.UsePadding = false;
            this.x36.StylePriority.UseTextAlignment = false;
            this.x36.Text = "Atölye";
            this.x36.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
            this.x36.Weight = 1.1799995913085277D;
            // 
            // x4a
            // 
            this.x4a.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "xKF_Header.Atolye")});
            this.x4a.Dpi = 254F;
            this.x4a.Name = "x4a";
            this.x4a.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 3, 3, 3, 254F);
            this.x4a.StylePriority.UsePadding = false;
            this.x4a.StylePriority.UseTextAlignment = false;
            this.x4a.Text = "x4a";
            this.x4a.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
            this.x4a.Weight = 2D;
            // 
            // x1
            // 
            this.x1.Dpi = 254F;
            this.x1.Font = new System.Drawing.Font("Calibri", 26F, System.Drawing.FontStyle.Bold);
            this.x1.LocationFloat = new DevExpress.Utils.PointFloat(690.5625F, 0F);
            this.x1.Name = "x1";
            this.x1.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 5, 0, 0, 254F);
            this.x1.SizeF = new System.Drawing.SizeF(1510.242F, 103.1875F);
            this.x1.StylePriority.UseFont = false;
            this.x1.StylePriority.UseTextAlignment = false;
            this.x1.Text = "Kesim Bilgi Formu";
            this.x1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopCenter;
            // 
            // xrPictureBox1
            // 
            this.xrPictureBox1.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Bookmark", null, "xKF_Header.ModelNo")});
            this.xrPictureBox1.Dpi = 254F;
            this.xrPictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("xrPictureBox1.Image")));
            this.xrPictureBox1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
            this.xrPictureBox1.Name = "xrPictureBox1";
            this.xrPictureBox1.SizeF = new System.Drawing.SizeF(493.1834F, 129.6458F);
            this.xrPictureBox1.Sizing = DevExpress.XtraPrinting.ImageSizeMode.StretchImage;
            // 
            // xKF_HeaderTableAdapter
            // 
            this.xKF_HeaderTableAdapter.ClearBeforeFill = true;
            // 
            // GroupFooter2
            // 
            this.GroupFooter2.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
            this.xrPageBreak2});
            this.GroupFooter2.Dpi = 254F;
            this.GroupFooter2.HeightF = 2F;
            this.GroupFooter2.Level = 1;
            this.GroupFooter2.Name = "GroupFooter2";
            // 
            // xrTable1
            // 
            this.xrTable1.Dpi = 254F;
            this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(2566F, 0F);
            this.xrTable1.Name = "xrTable1";
            this.xrTable1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
            this.xrTableRow21});
            this.xrTable1.SizeF = new System.Drawing.SizeF(203F, 58.42F);
            // 
            // xrTableRow21
            // 
            this.xrTableRow21.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.tcDosyaNo});
            this.xrTableRow21.Dpi = 254F;
            this.xrTableRow21.Name = "xrTableRow21";
            this.xrTableRow21.Weight = 1D;
            // 
            // tcDosyaNo
            // 
            this.tcDosyaNo.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
            new DevExpress.XtraReports.UI.XRBinding("Text", null, "xKF_Header.DosyaNo")});
            this.tcDosyaNo.Dpi = 254F;
            this.tcDosyaNo.Font = new System.Drawing.Font("Calibri", 9.75F, System.Drawing.FontStyle.Bold);
            this.tcDosyaNo.ForeColor = System.Drawing.Color.DarkRed;
            this.tcDosyaNo.Name = "tcDosyaNo";
            this.tcDosyaNo.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 254F);
            this.tcDosyaNo.StylePriority.UseFont = false;
            this.tcDosyaNo.StylePriority.UseForeColor = false;
            this.tcDosyaNo.StylePriority.UsePadding = false;
            this.tcDosyaNo.StylePriority.UseTextAlignment = false;
            this.tcDosyaNo.Text = "tcDosyaNo";
            this.tcDosyaNo.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
            this.tcDosyaNo.Weight = 1.9842518369708162D;
            // 
            // xrPageInfo1
            // 
            this.xrPageInfo1.Dpi = 254F;
            this.xrPageInfo1.LocationFloat = new DevExpress.Utils.PointFloat(2769F, 0F);
            this.xrPageInfo1.Name = "xrPageInfo1";
            this.xrPageInfo1.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 5, 0, 0, 254F);
            this.xrPageInfo1.RunningBand = this.DetailReport;
            this.xrPageInfo1.SizeF = new System.Drawing.SizeF(119F, 58.42F);
            this.xrPageInfo1.StylePriority.UseTextAlignment = false;
            this.xrPageInfo1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
            // 
            // xrTopluBedenDagilimi
            // 
            this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
            this.Detail,
            this.TopMargin,
            this.BottomMargin,
            this.ReportFooter,
            this.ReportHeader,
            this.Header,
            this.PageFooter});
            this.Bookmark = "ModelNo";
            this.Dpi = 254F;
            this.Font = new System.Drawing.Font("Calibri", 9.75F);
            this.Margins = new System.Drawing.Printing.Margins(41, 41, 84, 30);
            this.PageHeight = 2100;
            this.PageWidth = 2970;
            this.PaperKind = System.Drawing.Printing.PaperKind.A4Rotated;
            this.ReportUnit = DevExpress.XtraReports.UI.ReportUnit.TenthsOfAMillimeter;
            this.SnapGridSize = 31.75F;
            this.StyleSheet.AddRange(new DevExpress.XtraReports.UI.XRControlStyle[] {
            this.xrControlStyle1});
            this.Version = "15.2";
            this.BeforePrint += new System.Drawing.Printing.PrintEventHandler(this.xrKesim_BeforePrint);
            ((System.ComponentModel.ISupportInitialize)(this.oMyData)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.xtGarni)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.tbGarniHeader)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.xrTable4)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.xtM)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this)).EndInit();

    }

    protected override void Dispose(bool disposing)
    {
        if (disposing && (components != null))
        {
            components.Dispose();
        }
        base.Dispose(disposing);
    } 
    #endregion

    public xrTopluBedenDagilimi()
    {
        InitializeComponent();
    }

    int BrandId;
    int CikisPartisiId = 0;
    int CKBatchId = 0;
    public xrTopluBedenDagilimi(int BrandId, int CikisPartisiId, string Lang)
        : this()
    {
        this.CikisPartisiId = CikisPartisiId;
        this.BrandId = BrandId;
        this.Lang = Lang;

        
    }

    //public xrTopluBedenDagilimi(int BrandId, string Lang, int CKBatchId)
    //    : this()
    //{
    //    this.CKBatchId = CKBatchId;
    //    this.BrandId = BrandId;
    //    this.Lang = Lang;

    //}

    public string Lang;
    DataTable dtDetail = null;
    int BDWidth = 0;
    string[] colCaptions;   // = "SİPARİŞ;KESİLEN;YÜKLENEN;SAĞLAM;DEFOLU;EKSİK".Split(';');

    void cell_BeforePrint(object sender, PrintEventArgs e)
    {
        Graphics gr = Graphics.FromHwnd(IntPtr.Zero);
        gr.PageUnit = GraphicsUnit.Millimeter;
        //int factor = 10;

        XRLabel label = (XRLabel)sender;

        float stringWidth = gr.MeasureString(label.Text, label.Font).Width;
        float labelWidth = label.WidthF;

        float newSize = 10.25f;
        /*
        if ( labelWidth < stringWidth * factor)
            newSize = label.Font.Size * label.Width / stringWidth / factor;
        else
            newSize = 10.5f;
        */
        label.Font = new Font(this.Font.FontFamily, newSize);
        gr.Dispose();
    }

    void cell_BeforePrint2(object sender, PrintEventArgs e)
    {
        Graphics gr = Graphics.FromHwnd(IntPtr.Zero);
        gr.PageUnit = GraphicsUnit.Millimeter;
        int factor = 10;

        XRLabel label = (XRLabel)sender;

        float stringWidth = gr.MeasureString(label.Text, label.Font).Width;
        float labelWidth = label.WidthF;

        float newSize = 10.25f;

        if ( labelWidth < stringWidth * factor)
            newSize = label.Font.Size * label.Width / stringWidth / factor;
        else
            newSize = 10.25f;

        label.Font = new Font(this.Font.FontFamily, newSize);
        gr.Dispose();
    }
    DataTable dt;
    private void xrKesim_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
    {
        switch (Lang)
        {
            case "TR": colCaptions = "SİPARİŞ".Split(';'); break;
            case "IT": colCaptions = "ORDINE".Split(';'); break;
        }

        DataSet ds;
        if (CikisPartisiId > 0)
            ds = Session.DataManager.ExecuteDataSet("GetKF" + (BrandId == 8 ? "7" : "_DS"), CikisPartisiId, Lang);
        else
            ds = Session.DataManager.ExecuteDataSet("GetKF" + (BrandId == 8 ? "7x" : "_DSx"), CKBatchId, Lang);


        oMyData.Clear();
        oMyData.EnforceConstraints = false;
        oMyData.xKF_Header.Merge(ds.Tables[0]);
        oMyData.xKF_Detail.Merge(ds.Tables[1]);
        oMyData.KFCaptions.Merge(ds.Tables[2]);

        dt = new DataTable();
        dt.Merge(ds.Tables["Table3"]);

        oMyData.xKF_Detail.Columns.Add("Top", typeof(int), "ISNULL(A01,0)+ISNULL(A02,0)+ISNULL(A03,0)+ISNULL(A04,0)+ISNULL(A05,0)+ISNULL(A06,0)+ISNULL(A07,0)+ISNULL(A08,0)+ISNULL(A09,0)+ISNULL(A10,0)+ISNULL(A11,0)+ISNULL(A12,0)+ISNULL(A13,0)+ISNULL(A14,0)+ISNULL(A15,0)+ISNULL(A16,0)+ISNULL(A17,0)+ISNULL(A18,0)+ISNULL(A19,0)+ISNULL(A20,0)+ISNULL(A21,0)+ISNULL(A22,0)+ISNULL(A23,0)+ISNULL(A24,0)+ISNULL(A25,0)+ISNULL(A26,0)+ISNULL(A27,0)+ISNULL(A28,0)");
        oMyData.xKF_Detail.Columns.Add("Top0", typeof(decimal), "BM0*Top");
        oMyData.xKF_Detail.Columns.Add("Top1", typeof(decimal), "BM1*Top");
        oMyData.xKF_Detail.Columns.Add("Top2", typeof(decimal), "BM2*Top");
        oMyData.xKF_Detail.Columns.Add("Top3", typeof(decimal), "BM3*Top");
        oMyData.xKF_Detail.Columns.Add("Top4", typeof(decimal), "BM4*Top");
        oMyData.xKF_Detail.Columns.Add("Top5", typeof(decimal), "BM5*Top");
        oMyData.xKF_Detail.Columns.Add("Top6", typeof(decimal), "BM6*Top");
        oMyData.xKF_Detail.Columns.Add("TopP", typeof(decimal), "BMP*Top");

        List<XRTable> tables = new List<XRTable>();
        tables.AddRange(new XRTable[] {
             xtGarni
        });

        foreach (XRTable t in tables)
            foreach (XRTableRow r in t.Rows)
                foreach (XRTableCell cell in r)
                {
                    cell.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2);
                    cell.BeforePrint += new PrintEventHandler(cell_BeforePrint);
                    cell.WordWrap = false;
                }

        //x1.Text = G(1);
        x2.Text = G(2);
        x3.Text = G(3);
        x4.Text = G(4);
        x5.Text = G(5);
        x6.Text = G(6);
        x33.Text = G(33);
        x35.Text = G(35);
        x36.Text = G(36);


    }

    string G(int i)
    {
        return oMyData.KFCaptions.FindByidx(i).Expl;
    }

    string Fx(string TR, string IT)
    {
        switch (Lang)
        {
            case "TR": return TR; 
            case "IT": return IT; 
        }
        return string.Empty;
    }

    private void HeaderBand_BeforePrint(object sender, PrintEventArgs e)
    {
        DataRowView dv = (DataRowView)HeaderBand.Report.GetCurrentRow();
        
        int GarniAdedi = (int)dv.Row["GarniAdedi"];
        int ProfiloAdedi = (int)dv.Row["ProfiloAdedi"];
        int dagilimId = (int)dv.Row["DagilimId"];
        
        string model = dv.Row["ModelNo"].ToString();
        
        //CreateBDTable(model,dagilimId);

        CreateGarniTable(GarniAdedi, ProfiloAdedi, model, dagilimId);
    }

    private DataTable RemoveUnusedBDCols(DataTable dt)
    {
        string colNames = "";

        for (int i = 0; i < dt.Columns.Count; i++)
        {
            string activeColName = dt.Columns[i].ColumnName;
            //if (activeColName.StartsWith("x"))
            if (activeColName.StartsWith("A") && activeColName.Length == 3 && activeColName != "Art")
            {
                if ((dt.Compute(string.Format("sum({0})", activeColName), "")).ToInt() == 0)
                    colNames += dt.Columns[i].ColumnName + ";";
            }
            else
                colNames += dt.Columns[i].ColumnName + ";";
        }       
        
        foreach (string colName in colNames.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
        {
            dt.Columns.Remove(colName);
        }

        return dt;
    }

    

    private void CreateGarniTable(int GarniAdedi, int ProfiloAdedi,string model,int dagilimId)
    {
        int BDcellWidth = 70;
        DataRow[] drs = oMyData.xKF_Detail.Select("ModelNo ='" + model + "'");
        dtDetail = RemoveUnusedBDCols(drs.CopyToDataTable());
        BDWidth = dtDetail.Columns.Count * BDcellWidth + 270 + 50;

        xtGarni.BeginInit();
        xtGarni.Rows.Clear();
        tbGarniHeader.BeginInit();
        tbGarniHeader.Rows.Clear();

        int cellWidth = 300;
        int scanWidth = 150;
        float availableSpace = xrLine1.WidthF - BDWidth;
        if (!(cellWidth * (GarniAdedi + 1 + ProfiloAdedi) + scanWidth <= availableSpace))
        {
            cellWidth = Convert.ToInt16((availableSpace-10-scanWidth) / (GarniAdedi + 1 + ProfiloAdedi));
        }

        xtGarni.WidthF = tbGarniHeader.WidthF = xrLine1.WidthF; //cellWidth * (GarniAdedi + 1 + ProfiloAdedi);

        tbGarniHeader.Borders=  DevExpress.XtraPrinting.BorderSide.All;
        xtGarni.Borders = DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right | DevExpress.XtraPrinting.BorderSide.Bottom;
        XRTableRow tr;

        tr = new XRTableRow();

        #region Başlık

        XRTableCell tc = new XRTableCell();
        tc.WidthF = scanWidth;
        tc.Text = "Resim";
        tc.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
        tc.Font = new System.Drawing.Font(this.Font, FontStyle.Bold);
        tc.BackColor = Color.Gainsboro;
        tr.Cells.Add(tc);

        tc = new XRTableCell();
        tc.WidthF = cellWidth;
        tc.Text = Fx("Beden", "Corpo");
        tc.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
        tc.Font = new System.Drawing.Font(this.Font, FontStyle.Bold);
        tc.BackColor = Color.Gainsboro;
        tr.Cells.Add(tc);

        for (int i = 0; i < GarniAdedi; i++)
        {
            tc = new XRTableCell();
            tc.WidthF = cellWidth;
            tc.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
            tc.Text = Fx("Garni", "Interni") + (i + 1).ToString();
            tc.Font = new System.Drawing.Font(this.Font, FontStyle.Bold);
            tc.BackColor = Color.Gainsboro;
            tr.Cells.Add(tc);
        }

        if (ProfiloAdedi > 0)
        {
            tc = new XRTableCell();
            tc.WidthF = cellWidth;
            tc.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
            tc.Text = "Profilo";
            tc.Font = new System.Drawing.Font(this.Font, FontStyle.Bold);
            tc.BackColor = Color.Gainsboro;
            tr.Cells.Add(tc);
        }

        for (int i = 0; i < dtDetail.Columns.Count + 1; i++)
        {
            tc = new XRTableCell();
            tc.WidthF = BDcellWidth;
            tc.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
            if (i == dtDetail.Columns.Count)
            {
                tc.Text = "Top.";
                tc.WidthF = 100;
            }
            else
            {
                string colName = dtDetail.Columns[i].ColumnName;
                string caption;
                DataRow dr = dt.Select("Name='" + colName + "' AND DagilimId=" + dagilimId.ToString())[0];
                caption = dr["Beden"].ToString();
                if (caption.Contains("/"))
                {
                    caption = caption.Substring(caption.IndexOf('/') + 1, caption.Length - caption.IndexOf('/') - 1);
                }
                tc.Text = caption;
            }
            tc.Font = new System.Drawing.Font(this.Font, FontStyle.Bold);
            tc.BackColor = Color.Gainsboro;
            tr.Cells.Add(tc);
        }

        #endregion
        tbGarniHeader.Rows.Add(tr);
        tbGarniHeader.EndInit();

        tr = new XRTableRow();

        tc = new XRTableCell();
        tc.WidthF = scanWidth;
        tc.HeightF = scanWidth;
        tc.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;

        XRPictureBox xpic = new XRPictureBox();
        xpic.Dpi = 254;

        xpic.SizeF = new System.Drawing.SizeF(scanWidth, scanWidth);

        xpic.Borders = DevExpress.XtraPrinting.BorderSide.None;

        xpic.Sizing = DevExpress.XtraPrinting.ImageSizeMode.CenterImage;  // CenterImage;

        xpic.DataBindings.Add(new DevExpress.XtraReports.UI.XRBinding("Image", null, "xKF_Header.FK_xKF_Detail_xKF_Header.Photo0"));
        tc.Controls.Add(xpic);
        //tc.BorderColor = Color.LightGray;
        tr.Cells.Add(tc);

        #region ProductName
        for (int i = 0; i < GarniAdedi + 1; i++)
        {
            tc = new XRTableCell();
            tc.WidthF = cellWidth;
            tc.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
            tc.Font = new Font(this.Font.FontFamily, 10.5f);
            if (i < 1)
                tc.DataBindings.Add("Text", null, "xKF_Header.FK_xKF_Detail_xKF_Header.Corpo");
            else
                tc.DataBindings.Add("Text", null, "xKF_Header.FK_xKF_Detail_xKF_Header.Int" + i.ToString());
            //tc.BeforePrint += new PrintEventHandler(cell_BeforePrint);
            //tc.Multiline = true;
            tr.Cells.Add(tc);
        }

        if (ProfiloAdedi > 0)
        {
            tc = new XRTableCell();
            tc.WidthF = cellWidth;
            tc.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
            tc.Font = new Font(this.Font.FontFamily, 10.5f);
            tc.DataBindings.Add("Text", null, "xKF_Header.FK_xKF_Detail_xKF_Header.ProfiloTex");
            //tc.BeforePrint += new PrintEventHandler(cell_BeforePrint);
            tc.Multiline = true;
            tr.Cells.Add(tc);
        }

        for (int i = 0; i < colCaptions.Length; i++)
        {
            //if (i > 1)
            //    break;

            //tc = new XRTableCell();
            //tc.Text = colCaptions[i];
            //if (i > 0)
            //    tc.BorderColor = Color.LightGray;
            //tc.WidthF = 270;
            //tc.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;

            //tc.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 3, i > 0 ? 3 : 4, i > 0 ? 3 : 4);
            //tr.Cells.Add(tc);

            for (int j = 0; j < dtDetail.Columns.Count + 1; j++)
            {
                tc = new XRTableCell();
                tc.WidthF = BDcellWidth;
                tc.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
                if (i < 1)
                {
                    if (j == dtDetail.Columns.Count)
                    {
                        tc.Font = new System.Drawing.Font(this.Font, FontStyle.Bold);
                        tc.BackColor = Color.LemonChiffon;
                        tc.BeforePrint += new PrintEventHandler(cell_BeforePrint);
                        tc.DataBindings.Add("Text", null, "xKF_Header.FK_xKF_Detail_xKF_Header.Top");

                    }
                    else
                    {
                        string currentColName = dtDetail.Columns[j].ColumnName;
                        tc.DataBindings.Add("Text", null, "xKF_Header.FK_xKF_Detail_xKF_Header." + currentColName);
                    }

                }
                else
                    tc.BorderColor = Color.LightGray;

                if (j == dtDetail.Columns.Count)
                    tc.WidthF = 100;

                tr.Cells.Add(tc);
            }

        }

        #endregion       
        
        xtGarni.Rows.Add(tr);
        xtGarni.EndInit();

        foreach (XRTableRow row in xtGarni.Rows)
        {
            row.Cells[0].WidthF = 150;
        }

        tbGarniHeader.Rows[0].Cells[0].WidthF = 150;

        //tbGarniHeader.WidthF = xtGarni.WidthF = xrLine1.WidthF;
    }
}
